package osmedile.intellij.util.psi;

import com.intellij.psi.PsiElement;
import org.jetbrains.annotations.Nullable;

import java.util.Map;

/**
 * @author Olivier Smedile
 * @version $Id: File Header.java 3 2008-03-11 08:52:55Z osmedile $
 */
public interface Allower {

    /**
     * Return true if the content is allowed to differ from element to find
     *
     * @param content     original psi element
     * @param eltToFind   element to compare to
     * @param replacement Substitution map used to identify element that have differed.
     *                    Key is the original PsiElement and value is to element to be replaced with
     *                    Implementation should take of duplicate key
     *
     * @return true if the element is allowed to differ
     */
    boolean allowVariant(@Nullable PsiElement content, @Nullable PsiElement eltToFind,
                         Map<PsiElement, PsiElement> replacement);
}
